package cn.tpshion.config.service.support;

public enum AuthType {

    PASSWORD("password", "密码模式"),
    CODE("code", "授权码模式");

    /**
     * 认证方式
     */
    private String type;

    /**
     * 描述
     */
    private String desc;

    AuthType(String type, String desc){
        this.type = type;
        this.desc = desc;
    }

    /**
     * 检查授权类型
     * @param type
     * @return
     */
    public static boolean checkType(String type){
        for (AuthType authType : AuthType.values()) {
            if(authType.getType().equals(type)){
                return true;
            }
        }
        return false;
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }
}
